package session08.practise;

import javax.swing.*;
import java.awt.*;

public class ImagePanel extends JPanel {

    private JLabel imgLab;

    public ImagePanel(String fileName){
        this.setLayout(new BorderLayout());
        this.imgLab = new JLabel();
        ImageIcon icon = new ImageIcon(fileName);
        icon.setImage(icon.getImage().getScaledInstance(360,420,Image.SCALE_DEFAULT));
        this.imgLab.setIcon(icon);

        this.add(this.imgLab);

    }
}
